<div class="modal-header dialog-header-confirm">
    <h4 class="modal-title text-center">
        <i class="fa fa-pencil-square-o"></i>{{ 'cfgMgr.edit.title' | translate}}
    </h4>
</div>
<div class="modal-body">
    <ng-form name="modifyCfgDialog" novalidate role="form">
        <div ng-cloak class="form-group input-group-lg" ng-class="{true: 'has-error'}[modifyCfgDialog.cfgKey.$dirty && modifyCfgDialog.cfgKey.$invalid]">
            <label class="control-label" for="cfgKey">CfgKey:</label>
            <input type="text" class="form-control" placeholder="{{ 'cfgMgr.configKey' | translate}}" name="cfgKey" id="cfgKey" ng-model="cfg.cfgKey" required>
            <label class="control-label common-hidden {{isTypeEmpty()?'':(isFileType()?'':'no')}}" for="value">Value:</label>
            <input placeholder="{{ 'cfgMgr.configValue' | translate}}" type="text" class="form-control common-hidden {{isTypeEmpty()?'':(isFileType()?'':'no')}}"
                   name="value" id="value" ng-model="cfg.value" />

            <label class="control-label" for="type" placeholder="{{ 'cfgMgr.configType' | translate}}">Type:</label>
            <div style="margin-top: 10px;margin-bottom: 10px;" id="type" class="btn-group" uib-dropdown is-open="cfgModifyTypesDropdown.isOpen">
                <button type="button" class="btn btn-primary" uib-dropdown-toggle>
                    <span ng-bind="cfgModifyTypesDropdown.option.code"></span>
                    <span class="caret"></span>
                </button>
                <ul uib-dropdown-menu role="menu" aria-labelledby="single-button">
                    <li ng-repeat="it in cfgModifyTypesDropdown.items">
                        <a ng-click="cfgModifyTypesDropdown.selectOption(it)" ng-bind="it.code"></a>
                    </li>
                </ul>
            </div>
            <br />
            <label class="control-label common-hidden {{isTypeEmpty()?'':(!isFileType()?'':'no')}}" for="cfgFile">{{ 'cfgMgr.cfgFile' | translate}}:</label>
            <input class="control-label common-hidden {{isTypeEmpty()?'':(!isFileType()?'':'no')}}" id="cfgFile" type="file" nv-file-select uploader="uploader" />
            <br />
            <span class="text-danger"><strong>{{msg}}</strong></span>
        </div>
    </ng-form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" ng-click="cancel()">{{'dialog.cancel' | translate}}</button>
    <button ng-show="cfgModifyTypesDropdown && cfgModifyTypesDropdown.option.code != 'FILE'" type="button" class="btn btn-primary" ng-click="save()"
            ng-disabled="(addCfgDialog.$dirty && addCfgDialog.$invalid) || addCfgDialog.$pristine">{{'dialog.save' | translate}}</button>
    <button ng-show="cfgModifyTypesDropdown && cfgModifyTypesDropdown.option.code == 'FILE'" type="button" class="btn btn-primary" ng-click="upload()"
            ng-disabled="(addCfgDialog.$dirty && addCfgDialog.$invalid) || addCfgDialog.$pristine">{{'dialog.save' | translate}}</button>
</div>
